home *** CD-ROM | disk | FTP | other *** search
/ Workbench Design / WB Collection.iso / workbench werkzeuge / kickstart tools / zkick / zkick.i < prev    next >
Text File  |  1996-04-07  |  2KB  |  107 lines

  1. *************************************************************************
  2. *
  3. *    Copyright (C) 1985, Commodore Amiga Inc.  All rights reserved.
  4. *    Permission granted for non-commercial use
  5. *
  6. * asmsupp.i -- random low level assembly support routines
  7. *
  8. * Modified by Daniel Zenchelsky for use with ZKick
  9. *
  10. *************************************************************************
  11.  
  12. CLEAR    MACRO        ;quick way to clear a D register on 68000
  13.     MOVEQ    #0,\1
  14.     ENDM
  15.  
  16. ;BHS     MACRO
  17. ;     BCC.\0  \1 ;\0 is the extension used on the macro (such as ".s")
  18. ;     ENDM
  19. ;BLO     MACRO
  20. ;     BCS.\0  \1
  21. ;     ENDM
  22.  
  23. EVEN    MACRO        ; word align code stream
  24.     DS.W    0
  25.     ENDM
  26.  
  27. LINKSYS MACRO        ; link to a library without having to see a _LVO
  28.     MOVE.L    A6,-(SP)
  29.     MOVE.L    \2,A6
  30.     JSR    _LVO\1(A6)
  31.     MOVE.L    (SP)+,A6
  32.     ENDM
  33.  
  34. CALLSYS MACRO        ; call a library via A6 without having to see _LVO
  35.     JSR    _LVO\1(A6)
  36.     ENDM
  37.  
  38. XLIB    MACRO        ; define a library reference without the _LVO
  39.     XREF    _LVO\1
  40.     ENDM
  41. ;
  42. ; Put a message to the serial port at 9600 baud.  Used as so:
  43. ;
  44. ;     PUTMSG   <'Init: called'>
  45. ;
  46.         XREF    DPutStr
  47.  
  48. PUTMSG:     MACRO    * level,msg
  49.  
  50.         TST.L _PRINT
  51.         beq end\@
  52.  
  53.         MOVEM.L A0-A1/D0-D1,-(SP)
  54.         LEA    msg\@,A0    ;Point to static format string
  55.         JSR    DPutStr
  56.     
  57.         MOVE.L    #$000FFFFF,D0
  58. loop\@    DBRA        D0,loop\@        
  59.         SUB.L    #$10000,D0
  60.         BPL.S    loop\@
  61.         
  62.         MOVEM.L (SP)+,A0-A1/D0-D1
  63.         BRA.S    end\@
  64.  
  65. msg\@        DC.B    \1
  66.         DC.B    10
  67.         DC.B    0
  68.         DS.W    0
  69. end\@
  70.  
  71.         ENDM
  72.  
  73. ;
  74. ; Put a message to the serial port at 9600 baud.  Used as so:
  75. ;
  76. ;     NS_PUTMSG   <'Init: called'>
  77. ;
  78. ;    Uses NO stack, but trashes a0,a1,d0,d1
  79. ;
  80.         XREF    DPutStr
  81.  
  82. NS_PUTMSG:     MACRO    * level,msg
  83.  
  84.         TST.L _PRINT
  85.         beq end\@
  86.  
  87.         LEA    msg\@,A0    ;Point to static format string
  88.  
  89. a1\@:        MOVE.B    (A0)+,D0
  90.         BEQ.S    end\@
  91. a3\@:    MOVE.B    $BFD000,D1
  92.         BTST        #0,D1
  93.         BNE.S    a3\@
  94.         MOVE.B    #$FF,$BFE301
  95.         MOVE.B    D0,$BFE101
  96.  
  97.         BRA.S    a1\@
  98.  
  99. msg\@:    DC.B    \1
  100.         DC.B    10
  101.         DC.B    0
  102.         DS.W    0
  103. end\@:
  104.  
  105.         ENDM
  106.  
  107.